home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
16
/
fpc225_3.zip
/
F-PCHELP.ZIP
/
COMPAT.TXT
< prev
next >
Wrap
Text File
|
1988-06-04
|
2KB
|
50 lines
COMPAT.TXT Compatibility problems in F-PC by Tom Zimmer
F-PC is a Forth system which moves the LIST portion of a ":" COLON
definition into another segment. The technique used in F-PC to
accomplish this causes very few problems with compatibility, but
there are a few, so here are the ones I know about.
EXECUTION ARRAYS
A popular F83 programming technique for creating a table of
execution vectors is as follows:
CREATE mytable ]
func0 func1 func2 func3 func4 func5 func6
func7 func8 func9 func10 [
: domytable ( n1 --- )
2* mytable + PERFORM ;
It works like this, a number n1 is passed to DOMYTABLE, which
causes function number n1 to be performed from the table MYTABLE.
F-PC has a problem with the above technique, as the CREATE creates
MYTABLE in CODE space, and the FUNC's are compiled in LIST space.
That is, in another segment. Since MYTABLE will return an address in
CODE space, DOMYTABLE will misfunction.
To deal with this type of problem, F-PC provides a function called
EXEC: which I obtained from Charles Curley with this definition:
: EXEC: ( n1 --- )
2* R> + XPERFORM ;
EXEC: is used as follows:
: domytable ( n1 --- )
EXEC:
func0 func1 func2 func3 func4 func5 func6
func7 func8 func9 func10 ;
I think you will agree that this is a reasonable solution, The word
EXEC: can infact be implimented on a normal F83 system, using PERFORM
instead of XPERFORM, to provide the same functionality with complete
portability of code across systems. As you can see the definiton
MYTABLE was not even needed, and the definition above is just a
normal COLON definition which can be debugged, decompiled ect.